import { CHANGE_ID, REQ_GET_CHANNELS_LIST } from "../constants/channels"
const initState ={
  channelList:[],
  active:0
}
export const channels = (state=initState,action) => {
  switch(action.type) {
    case REQ_GET_CHANNELS_LIST : {
      return {
        ...state,
        channelList:action.payload.data.data.channels
      };
  }
  case CHANGE_ID : {
    return {
      ...state,
      active:action.id
    }
  }
    
    default : return state;
  }
}